home *** CD-ROM | disk | FTP | other *** search
- package sun.awt.image;
-
- import java.io.BufferedInputStream;
- import java.io.ByteArrayInputStream;
- import java.io.InputStream;
-
- public class ByteArrayImageSource extends InputStreamImageSource {
- byte[] imagedata;
- int imageoffset;
- int imagelength;
-
- public ByteArrayImageSource(byte[] data) {
- this(data, 0, data.length);
- }
-
- public ByteArrayImageSource(byte[] data, int offset, int length) {
- this.imagedata = data;
- this.imageoffset = offset;
- this.imagelength = length;
- }
-
- final boolean checkSecurity(Object context, boolean quiet) {
- return true;
- }
-
- protected ImageDecoder getDecoder() {
- InputStream is = new BufferedInputStream(new ByteArrayInputStream(this.imagedata, this.imageoffset, this.imagelength));
- return ((InputStreamImageSource)this).getDecoder(is);
- }
- }
-